---
---
<!-- title: EE 1.14 Upgrade: Running the EE 1.12 and Earlier URL Redirect Script -->
<!-- URL: ee-112-and-earlier-url-redirect-script -->

<!DOCTYPE html>
<html lang=en>

<head>
    <meta charset=utf-8>

    <link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/common/css/stylesheet.css"/>
    <link rel="stylesheet" href="{{ site.baseurl }}/common/css/stylesheet-fonts.css" type="text/css" charset="utf-8">
    <link rel="icon" href="{{ site.baseurl }}/common/css/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="{{ site.baseurl }}/common/css/favicon.ico" type="image/x-icon">
    <title>EE 1.14 Upgrade: Running the EE 1.12 and Earlier URL Redirect Script</title>

</head>

<body>
<a name="top"></a>
<img src="{{ site.baseurl }}/common/images/m1x/m1xheader.png" width="1024" alt="header" />

<div id="content"> 

<h1>EE 1.14 Upgrade: Running the EE 1.12 and Earlier URL Redirect Script </h1>

<p>This article is part of the Magento Enterprise Edition (EE) upgrade documentation. If you're looking for something else, <a href="http://www.magentocommerce.com/resources/magento-user-guide" target="_blank">click here</a> to go back to the Magento Knowledge Base.</p>
<p>This article applies to the following Magento EE upgrades:</p>
<ul><li>From EE 1.12.x or earlier to EE 1.13.0.2</li>
<li>From EE 1.12.x or earlier to EE 1.13.1.0</li>
<li>From EE 1.12.x or earlier to EE 1.14.0.0</li></ul>
<p>If your upgrade is not in the preceding list, go back to <a href="{{ site.m1xgdeurl }}install/installing_upgrade_details.html">Upgrading to and Verifying Magento Community Edition (CE) 1.8 and Enterprise Edition (EE) 1.13</a>.</p>
<p>This article discusses how to run the URL redirect script that creates HTTP 301 (Moved Permanently) redirects for any duplicate product URL keys. This enables <strong>Previous</strong> links in your web store to work, for example.</p>
<!-- <p>To run the URL redirect script, see <a href="{{ site.m1xgdeurl }}install/installing_upgrade_from-ee112.html" target="_blank">EE 1.14 Upgrade: Running the EE 1.12 and Earlier URL Redirect Script</a>. When you're done, continue with the next section. -->
<p>To create redirects for your URLs, perform the following tasks in the order shown:</p>
<ol><li><a href="#upgrade-manual-post-upgrade-11302-cron-verify">Verifying that cron is Disabled</a></li>
<li><a href="#upgrade-manual-post-upgrade-11302-indexer">Changing Indexer Settings to Update When Scheduled</a></li>
<!-- <li><a href="#upgrade-manual-post-upgrade-11302-clear">Flushing the Cache</a></li>
<li><a href="#upgrade-manual-post-upgrade-11302-reindex">Reindexing</a></li> -->
<li><a href="#upgrade-manual-post-upgrade-11302-run">Running the URL Redirect Script</a></li>
<li><a href="#upgrade-manual-post-upgrade-11302-full-reindex">Running a Full Reindex from the Command Line</a></li>
<li><a href="#upgrade-manual-post-upgrade-11302-view-redirs">Viewing the List of Redirects</a></li>
<li><a href="#upgrade-manual-post-upgrade-11302-verify">Verifying That URLs Work Properly</a></li>
<li><a href="#complete-upgrade">Completing Your Upgrade</a></li></ol>

<h2 id="upgrade-manual-post-upgrade-11302-cron-verify">Verifying that cron is Disabled</h2>
<p>It's very important to stop cron jobs from running until after the upgrade script completes. To do so, enter one of the following commands as a user with <code>root</code> privileges:</p>
<ul><li>Ubuntu: <code>service crond stop</code></li>
<li>CentOS: <code>service cron stop</code></li></ul>

<h2 id="upgrade-manual-post-upgrade-11302-indexer">Changing Indexer Settings to Update When Scheduled</h2>
<p>To change indexer settings:</p>
<ol><li>Click <strong>System</strong> > <strong>Configuration</strong>.</li>
<li>In the left navigation bar, in the ADVANCED group, click <strong>Index Management</strong>.</li>
<li>In the right pane, expand <strong>Index Options</strong>.</li>
<li>Click <strong>Update when scheduled</strong> from the list for every indexer.<br />
The following figure shows an example.<br />
<img src="{{ site.baseurl }}/common/images/m1x/upgrade_index-management_when-scheduled.png" width="600px" height="258px"></li>
<li>In the upper right corner, click <strong>Save Config</strong>.<br />
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-note.png" alt="note" align="left" width="40"><span><strong>注意</strong>: Ignore any messages requesting you to reindex or flush the cache; you'll do that later.</div></li>
<li>Log out of the Admin Panel.</li>
<li>If the script ran without errors, continue with <a href="#upgrade-manual-post-upgrade-11302-run">Running the URL Redirect Script</a>.</li></ol>

<!-- <h2 id="upgrade-manual-post-upgrade-11302-clear">Flushing the Cache</h2>
<p>To flush the cache before running the URL redirect script:</p>
<ol><li>In the Admin Panel, click <strong>System</strong> > <strong>Cache Management</strong>.</li>
<li>Click <strong>Flush Magento Cache</strong>.</li>
<li>Log out of the Admin Panel.</li></ol>

<h2 id="upgrade-manual-post-upgrade-11302-reindex">Reindexing</h2>
<p>If messages display in the Admin Panel indicating you need to reindex:</p>
<ol><li>In the Admin Panel, click <strong>System</strong> > <strong>Index Management</strong>.</li>
<li>Click the <strong>Reindex Data</strong> next to each indexer whose status is Reindex Required.</li></ol> -->

<h2 id="upgrade-manual-post-upgrade-11302-run">Running the URL Redirect Script</h2>
<p>This section discusses how to run the URL redirect script to create permanent redirects for any URLs that changed in EE 1.13.1.0.</p>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-note.png" alt="note" align="left" width="40"><span><strong>注意</strong>: The time the script takes to run and the amount of memory it uses is directly proportional to the size of your database. If your database has 100,000 SKUs or more, Magento <em>strongly recommends</em> you monitor thread execution as discussed in this section. For large databases, the script can require several hours to complete.</div>

<p>To run the script:</p>
<ol><li>Change to your Magento installation directory.</li>
<li>As the user who owns the files (typically, either <code>root</code> or the web server user), enter the following command:<br />
<pre>php -f shell/url_migration_to_1_13.php - <em>thread-count</em></pre>
where<br />
<em>thread_count</em> is the number of threads to use. Magento recommends setting this to the number of CPU cores in your system minus 1 to a maximum of 15. 例如， if your system has 8 CPU cores, enter
<pre>php -f shell/url_migration_to_1_13.php 7</pre>
<div class="msg-box important"><img src="{{ site.baseurl }}/common/images/m1x/icon-note.png" alt="note" align="left" width="40"><span><strong>注意</strong>: Each thread can use up to 512MB of RAM.</div></li>
<li>Wait while the script runs.<br />
Messages like the following display to indicate progress: <br />
<pre>[INFO]: Initialization...
[INFO]: Renaming conflicting entities...
100% [#################################################################################]
[INFO]: Creating redirects from previous version...
100% [#################################################################################]
ETA <em>HH:MM:SS</em></pre></li>
<li>If you have a large database, open another command window and run the following command:<br />
<pre>watch -n1 "ps ax | grep umt | grep -v grep"</pre>
This command helps you to determine if each thread behaves correctly. After each process finishes, a new process should start immediately. There should be no delays or "hangs" between processes.</li>
<li>If the script runs successfully, continue with <a href="#upgrade-manual-post-upgrade-11302-full-reindex">Running a Full Reindex from the Command Line</a>.</li></ol>
<p>If errors display, check <code>[your Magento install dir]/shell/migration.log</code> for exceptions and see the following table.</p>
<p><strong>故障排除</strong></p>
<table>
<col width="25%">
<col width="75%">
<tbody>
<tr>
  <th>Symptom</th>
  <th>Suggested action</th>
</tr>
<tr>
  <td><code>ERROR: Scope of attribute "url_key" is set to Global. This may cause DB inconsistency. Aborting.</code></td>
  <td><p>This error can be caused by either a product or category <code>url_key</code> attribute being set for Global scope. To determine which type of <code>url_key</code> attribute is causing the error:</p>
  <ol><li>Log in as an administrator to the Admin Panel of the production system (in other words, the system you're upgrading <em>from</em>).</li>
  <li>Click <strong>Catalog</strong> > <strong>Attributes</strong> > <strong>Manage Attributes</strong>.</li>
  <li>Click the <strong>url_key</strong> row</strong>.</li>
  <li>Examine the value of the <strong>Scope</strong> list. A sample follows.<br />
  <img src="{{ site.baseurl }}/common/images/m1x/index-management_product-url-key-attrib.png"></li>
  <li>If the value in the <strong>Scope</strong> list is <strong>Global</strong>:
  <ol><li style="list-style-type:lower-alpha">Select another value from the list. You can select any value <em>other than</em> <strong>Global</strong>.</li>
  <li style="list-style-type:lower-alpha">Click <strong>Save Attribute</strong>.</li>
  <li style="list-style-type:lower-alpha">Log out of the Admin Panel.</li>
  <li style="list-style-type:lower-alpha">Re-export the database as discussed in <a href="{{ site.m1xgdeurl }}install/installing_upgrade_details.html#prereq-tasks-prod-backup-db" target="_blank">Backing Up the Database</a>.</li>
  <li style="list-style-type:lower-alpha">In the development system, drop and re-create the database as discussed in <a href="{{ site.m1xgdeurl }}install/installing_upgrade_details.html#prereq-tasks-dev" target="_blank">Pre-Upgrade Tasks for Your Development Environment</a>.</li>
  <li style="list-style-type:lower-alpha">Import the database you just exported as discussed in <a href="{{ site.m1xgdeurl }}install/installing_upgrade_details.html#upgrade-manual-db" target="_blank">Updating the Magento Database</a>.</li>
  <li style="list-style-type:lower-alpha">Try running the upgrade script again.</li></ol>
  </li>
  <li>If the value of the <strong>Scope</strong> list is <em>not</em> <strong>Global</strong>, the issue is likely that the category <code>url_key</code> attribute is set to global. To confirm this:
  <ol><li style="list-style-type:lower-alpha">Log out of the Admin Panel.</li>
  <li style="list-style-type:lower-alpha">In the development database instance, use either the MySQL command line or phpmyadmin to get the value of <code>is_global</code> from the <code>catalog_eav_attribute</code> table. If the value is <code>1</code>, your catalog <code>url_key</code> attribute is set to Global.<br />
  Following is an example of finding the value using the MySQL command line:<br />
  <pre>select attribute_id, is_global from catalog_eav_attribute /
  where attribute_id in (select attribute_id from eav_attribute /
  where attribute_code = 'url_key');</pre><br />
  <strong>Note:</strong> The command must be entered on a single line. It is shown here on multiple lines because of space limitations. When you enter the command, omit the <code>/</code> characters.</li>
  <li style="list-style-type:lower-alpha">If any returned value is <code>1</code>, you must contact <a href="http://support.magentocommerce.com" target="_blank">Magento Support</a>.</li></ol>
</li></ol></td>
</tr>
<tr>
  <td>Other errors</td>
  <td>Try running the script again. If errors persist, contact <a href="http://support.magentocommerce.com" target="_blank">Magento Support</a>.</td>
</tbody>
</table>

<h2 id="upgrade-manual-post-upgrade-11302-full-reindex">Running a Full Reindex from the Command Line</h2>
<p>After successfully running the URL redirect script, enter the following command from the Magento root directory:</p>
<pre>php -f shell/indexer.php --reindexall</pre>
<p>This command runs a full reindex and it might take a long time, depending on the size of your database.</p>
<p>After the reindex completes, enter the following command from your Magento installation directory:</p>
<pre>rm -rf var/cache var/full_page_cache var/locks</pre>

<h2 id="upgrade-manual-post-upgrade-11302-view-redirs">Viewing the List of Redirects</h2>
<p>As a result of running the URL redirect script, a list of redirects created for duplicate URL keys displays in the Admin Panel. To view these redirects:</p>
<ol><li>Log in to the Admin Panel as an administrator.</li>
<li>Click <strong>Catalog</strong> > <strong>URL Redirects</strong>.</li>
<li>To optionally sort results by description, click the <strong>描述</strong> column.<br />
All redirects created by the URL redirect script display the following description:<br />
<pre>1.12.0.2-1.13.x migration redirect</pre>
The following figure shows an example.<br />
<img src="{{ site.baseurl }}/common/images/m1x/upgrade_url-redirects.png" width="600px" height="159px"></li></ol>

<h2 id="upgrade-manual-post-upgrade-11302-verify">Verifying That URLs Work Properly</h2>
<p>Assuming all your post-upgrade issues are fixed, go to your web store and navigate the category tree. Click some products and make sure they display properly. Verify that all <strong>Previous</strong>和<strong>Back</strong> links work properly.</p>

<h2 id="complete-upgrade">Completing Your Upgrade</h2>
<p>Complete your upgrade:</p>
<ol><li><a href="{{ site.m1xgdeurl }}install/installing_install.html#install-cron" target="_blank">Setting Up the Magento Cron Job</a></li>
<li><a href="{{ site.m1xgdeurl }}install/installing_upgrade_details.html#upgrade-manual-var">Clearing Magento var/ Subdirectories</a></li>
<li>Complete the remainder of the tasks on that page in the order shown</li></ol>